
import java.awt.*;

public class GameSelect {//游戏难度选择类

    boolean selection(){//判断鼠标是否点击到难度选择框
        if(GameUtil.MouseX>100&&GameUtil.MouseX<400){
            if(GameUtil.MouseY>50&&GameUtil.MouseY<150){
                GameUtil.level=1;
                GameUtil.state=0;
                return true;
            }
            if(GameUtil.MouseY>200&&GameUtil.MouseY<300){
                GameUtil.level=2;
                GameUtil.state=0;
                return true;
            }
            if(GameUtil.MouseY>350&&GameUtil.MouseY<450){
                GameUtil.level=3;
                GameUtil.state=0;
                return true;
            }
        }
        return false;
    }

    void paintSelf(Graphics g){
        g.setColor(Color.black);
        g.drawRect(100,50,300,100);
        GameUtil.drawWord(g,"初级",220,115,40,Color.black);

        g.drawRect(100,200,300,100);
        GameUtil.drawWord(g,"中级",220,265,40,Color.black);

        g.drawRect(100,350,300,100);
        GameUtil.drawWord(g,"高级",220,415,40,Color.black);
    }

    void selection(int level){
        switch (level){
            case 1:
                GameUtil.MineNumber = 10;
                GameUtil.Width = 9;
                GameUtil.Height = 9;
                break;
            case 2:
                GameUtil.MineNumber = 20;
                GameUtil.Width = 16;
                GameUtil.Height = 16;
                break;
            case 3:
                GameUtil.MineNumber = 30;
                GameUtil.Width = 25;
                GameUtil.Height = 16;
                break;
            default:
        }
    }
}
